package org.zhaoxi.demo2;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author zxiaoming
 * @Description:测试基于注解的IOC和DI
 * @date 2021/2/2521:38
 */
public class TestAnnotation {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationcontext-annotation.xml");
        //默认名称为当前标记类的名称的首字母小写
        ServiceBean bean = context.getBean("serviceBean", ServiceBean.class);
        bean.helloService();
    }
}
